from sqlalchemy import Column, Integer, String, Date, DateTime

from model.sqlConnect import Base, SqliteSqlalchemy


class BoardGameTable(Base):
    # 定义表名
    __tablename__ = 'BOARD_GAME_TABLE'
    # 定义字段
    id_board_game_table = Column(Integer, autoincrement="auto", primary_key=True)
    no = Column(String(20))
    name = Column(String(20))
    price_h = Column(Integer)
    status = Column(String(2))
    is_deleted = Column(String(2), default="N")
    create_at = Column(DateTime)
    update_at = Column(DateTime)


def queryAll(boardGameTable):
    session = SqliteSqlalchemy().session
    result = session.query(BoardGameTable).all()
    session.close()
    return result

def insert(boardGameTable):
    session = SqliteSqlalchemy().session
    result = session.query(BoardGameTable).all()
    session.close()
    return result

def delete(boardGameTable):
    session = SqliteSqlalchemy().session
    result = session.query(BoardGameTable).all()
    session.close()
    return result
def update(boardGameTable):
    session = SqliteSqlalchemy().session
    result = session.query(BoardGameTable).all()
    session.close()
    return result